//
//  DSAnimations.m
//  Router
//
//  Created by DongSen on 2019/1/9.
//  Copyright © 2019年 董森森. All rights reserved.
//

#import "DSAnimations.h"

@implementation DSAnimations

- (void)animateTransition:(nonnull id<UIViewControllerContextTransitioning>)transitionContext {
    
    
}

- (NSTimeInterval)transitionDuration:(nullable id<UIViewControllerContextTransitioning>)transitionContext {
    return self.duration;
}

- (CGFloat)duration{
    if (!_duration) {
        _duration = 1.0f;
    }
    return _duration;
}

#pragma mark--UINavigationControllerDelegate
- (nullable id <UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController
                                            animationControllerForOperation:(UINavigationControllerOperation)operation
                                                         fromViewController:(UIViewController *)fromVC
                                                           toViewController:(UIViewController *)toVC  NS_AVAILABLE_IOS(7_0){
    
    return self;
    return nil;
}

#pragma mark --UIViewControllerTransitioningDelegate
- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source{
    
    return self;
    return nil;//如果 return nil 则使用系统默认动画
}

- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed{
    
    return self;
    return nil;//如果 return nil 则使用系统默认动画
    
}

@end

